import React, { createContext } from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { BrowserRouter } from 'react-router-dom'
// 导入守护者
import { PersistGate } from 'redux-persist/integration/react'
import { persistor } from '../src/store/index.js'
import store from '../src/store/index.js'
// 创建上下文对象
var context = createContext();

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  <BrowserRouter>
    <context.Provider store={store} value="">
      <PersistGate loading={null} persistor={persistor}>
        <App />
      </PersistGate>
    </context.Provider>
  </BrowserRouter>
);

reportWebVitals();
